<div ng-init="init();" class="kmi-layout-content B0238-content">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="brand-title">
            <div class="custom" ng-if="companyName">
                <div class="title" ng-bind="companyName"></div>
                <img src="" alt="" class="brand">
                <div class="gap"></div>
            </div>
            <div class="digiwin">
                <img src="image/smes_v340/logo_ch.png" alt="">
                <img src="image/smes_v340/logo_en.png" alt="">
            </div>
        </div>
        <div class="header-title" ng-bind="'B0238.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <div>
                <div class="kmi-report-panel"></div>
                <div class="kmi-text-fields conditoin-field">
                    <label class="label" ng-bind="'B0238.work_type' | translate"></label>
                    <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="chengeType('1')">
                        <img ng-show="work_type != '1'" src="image/icons/check0.png"></img>
                        <img ng-show="work_type == '1'" src="image/icons/check1.png"></img>
                        {{'B0238.stockIn' | translate}}
                    </button>
                    <button class="mdl-button mdl-js-button kmi-checkbox" ng-click="chengeType('0')">
                        <img ng-show="work_type != '0'" src="image/icons/check0.png"></img>
                        <img ng-show="work_type == '0'" src="image/icons/check1.png"></img>
                        {{'B0238.issue_material' | translate}}
                    </button>
                </div>
                <div class="kmi-text-fields conditoin-field">
                    <label class="label" ng-bind="'B0238.quick_select' | translate"></label>
                    <input class="value" ng-model="accessory_no" ng-keypress="barcode_accessory_no($event);" id="accessory_no"></input>
                    <div class="tip qrcode" ng-click="qrcode_accessory_no();" style="top: 2px;right: 27px;">
                        <img src="image/icons/QRCode.png">
                    </div>
                </div>
            </div>
            <div class="kmi-list column-selector" column-selector-id="B0238_workItemList">
                <div class="kmi-list__header">
                    <!-- 20230313 modify by Alan for M#129881: -->
                    <div class="kmi-list__column width-fixed" style="flex:0 0 40px">
                        <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="selectAll();">
                            <img ng-if="!isSelectAll" src="image/icons/check0.png"></img>
                            <img ng-if="isSelectAll"  src="image/icons/check1.png"></img>
                        </button>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.acc_no">
                            <input ng-model="dispatch_filter.acc_no">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.acc_no = false;dispatch_filter.acc_no = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.acc_no">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.acc_no = true">search</i>
                            <label ng-bind="'B0238.list.acc_no'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'acc_no'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('acc_no')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.acc_type">
                            <input ng-model="dispatch_filter.acc_type">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.acc_type = false;dispatch_filter.acc_type = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.acc_type">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.acc_type = true">search</i>
                            <label ng-bind="'B0238.list.acc_type'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'acc_type'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('acc_type')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.acc_category">
                            <input ng-model="dispatch_filter.acc_category">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.acc_category = false;dispatch_filter.acc_category = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.acc_category">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.acc_category = true">search</i>
                            <label ng-bind="'B0238.list.acc_category'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'acc_category'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('acc_category')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.locator_no">
                            <input ng-model="dispatch_filter.locator_no">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.locator_no = false;dispatch_filter.locator_no = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.locator_no">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.locator_no = true">search</i>
                            <label ng-bind="'B0238.list.locator_no'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'locator_no'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('locator_no')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.current_residual_life">
                            <input ng-model="dispatch_filter.current_residual_life">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.current_residual_life = false;dispatch_filter.current_residual_life = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.current_residual_life">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.current_residual_life = true">search</i>
                            <label ng-bind="'B0238.list.current_residual_life'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'current_residual_life'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('current_residual_life')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.current_total_residual_life">
                            <input ng-model="dispatch_filter.current_total_residual_life">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.current_total_residual_life = false;dispatch_filter.current_total_residual_life = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.current_total_residual_life">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.current_total_residual_life = true">search</i>
                            <label ng-bind="'B0238.list.current_total_residual_life'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'current_total_residual_life'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('current_total_residual_life')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.std_number_cavity">
                            <input ng-model="dispatch_filter.std_number_cavity">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.std_number_cavity = false;dispatch_filter.std_number_cavity = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.std_number_cavity">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.std_number_cavity = true">search</i>
                            <label ng-bind="'B0238.list.std_number_cavity'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'std_number_cavity'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('std_number_cavity')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.good_number_cavity">
                            <input ng-model="dispatch_filter.good_number_cavity">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.good_number_cavity = false;dispatch_filter.good_number_cavity = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.good_number_cavity">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.good_number_cavity = true">search</i>
                            <label ng-bind="'B0238.list.good_number_cavity'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'good_number_cavity'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('good_number_cavity')"></div>
                        </div>
                    </div>
                    <div class="kmi-list__column head-controls" style="flex:1;">
                        <div class="filter" ng-show="dispatch_filterSH.combine_acc">
                            <input ng-model="dispatch_filter.combine_acc">
                            <i class="material-icons clear" style="position: absolute;top: 2px;right: 4px;"
                               ng-click="dispatch_filterSH.combine_acc = false;dispatch_filter.combine_acc = '';">clear</i>
                        </div>
                        <div class="order" ng-hide="dispatch_filterSH.combine_acc">
                            <i class="material-icons search" style="z-index:1;" ng-click="dispatch_filterSH.combine_acc = true">search</i>
                            <label ng-bind="'B0238.list.combine_acc'| translate"></label>
                            <i class="material-icons" ng-show="order_by_mode.name == 'combine_acc'">{{order_by_mode.sort?'&#xE5DB;':'&#xE5D8;'}}</i>
                            <div class="kmi-can-click" ng-click="orderbychange('combine_acc')"></div>
                        </div>
                    </div>
                    <!--<div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.acc_no' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.acc_type' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.acc_category' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.locator_no' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.current_residual_life' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.current_total_residual_life' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.std_number_cavity' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.good_number_cavity' | translate"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0238.list.combine_acc' | translate"></div>-->
                </div>
                <div class="kmi-list__row-content">
                    <!-- 20210401 modify by 奕達 for M#89807 -->
                    <div class="kmi-list__row" ng-repeat="item in getPages(workItemList, PageConfig, dispatch_filter) track by $index">
                        <div class="kmi-list__column" style="flex:0 0 40px;">
                            <button class="mdl-button mdl-js-button mdl-button--icon">
                                <img ng-show="!item.btn_mode" src="image/icons/check0.png"></img>
                                <img ng-show="item.btn_mode" src="image/icons/check1.png"></img>
                            </button>
                        </div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.acc_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.acc_type"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.acc_category"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.locator_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.current_residual_life"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.current_total_residual_life"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.std_number_cavity"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.good_number_cavity"></div>
                        <div class="kmi-list__column column-border" style="flex:1;">
                            <label class="value"  ng-bind="'common.btn.no' | translate" ng-show="item.combine_acc=='0'"></label>
                            <label class="value" ng-bind="'common.btn.yes' | translate" ng-show="item.combine_acc=='1'"></label>
                        </div>
                        <div class="kmi-can-click" ng-click="item.btn_mode = !item.btn_mode"></div>
                    </div>
                </div>
            </div>
            <!-- 20210506 modify by 14169 for M#92169 增加分页 -->
            <div class="page-content">
                <div class="page-icon">
                    <i class="material-icons">&#xE314;</i>
                    <div class="kmi-can-click"  ng-click="PageConfig.page = (PageConfig.page-1<0?0:PageConfig.page-1);"></div>
                </div>
                <label ng-bind="(PageConfig.page +1)+' / '+PageConfig.total_page"></label>
                <div class="page-icon">
                    <i class="material-icons">&#xE315;</i>
                    <div class="kmi-can-click"  ng-click="PageConfig.page = (PageConfig.page+1>(PageConfig.total_page-1)?(PageConfig.total_page-1):PageConfig.page+1);"></div>
                </div>
            </div>
        </div>
        <div class="kmi-layout-footer">
            <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1"
            ng-click="confirm();">
              <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
